package com.example.auth.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @TableName app_client
 */
@TableName(value ="app_client")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AppClient implements Serializable {
    /**
     * 
     */
    @TableId
    private Long id;

    /**
     * 
     */
    private String clientIcon;

    /**
     * 
     */
    private String clientId;

    /**
     * 
     */
    private Date clientIdIssuedAt;

    /**
     * 
     */
    private String clientSecret;

    /**
     *
     */
    private String clientSecretText;

    /**
     * 
     */
    private Date clientSecretExpiresAt;

    /**
     * 
     */
    private String clientName;

    /**
     * 
     */
    private String clientAuthenticationMethods;

    /**
     * 
     */
    private String authorizationGrantTypes;

    /**
     * 
     */
    private String redirectUris;

    /**
     * 
     */
    private String postLogoutRedirectUris;

    /**
     * 
     */
    private String scopes;

    /**
     * 
     */
    private Boolean requireApprove;

    /**
     * 
     */
    private Integer authorizationCodeTimeToLive;

    /**
     * 
     */
    private Integer accessTokenTimeToLive;

    /**
     * 
     */
    private Boolean reuseRefreshTokens;

    /**
     * 
     */
    private Integer refreshTokenTimeToLive;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AppClient other = (AppClient) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getClientIcon() == null ? other.getClientIcon() == null : this.getClientIcon().equals(other.getClientIcon()))
            && (this.getClientId() == null ? other.getClientId() == null : this.getClientId().equals(other.getClientId()))
            && (this.getClientIdIssuedAt() == null ? other.getClientIdIssuedAt() == null : this.getClientIdIssuedAt().equals(other.getClientIdIssuedAt()))
            && (this.getClientSecret() == null ? other.getClientSecret() == null : this.getClientSecret().equals(other.getClientSecret()))
            && (this.getClientSecretExpiresAt() == null ? other.getClientSecretExpiresAt() == null : this.getClientSecretExpiresAt().equals(other.getClientSecretExpiresAt()))
            && (this.getClientName() == null ? other.getClientName() == null : this.getClientName().equals(other.getClientName()))
            && (this.getClientAuthenticationMethods() == null ? other.getClientAuthenticationMethods() == null : this.getClientAuthenticationMethods().equals(other.getClientAuthenticationMethods()))
            && (this.getAuthorizationGrantTypes() == null ? other.getAuthorizationGrantTypes() == null : this.getAuthorizationGrantTypes().equals(other.getAuthorizationGrantTypes()))
            && (this.getRedirectUris() == null ? other.getRedirectUris() == null : this.getRedirectUris().equals(other.getRedirectUris()))
            && (this.getPostLogoutRedirectUris() == null ? other.getPostLogoutRedirectUris() == null : this.getPostLogoutRedirectUris().equals(other.getPostLogoutRedirectUris()))
            && (this.getScopes() == null ? other.getScopes() == null : this.getScopes().equals(other.getScopes()))
            && (this.getAuthorizationCodeTimeToLive() == null ? other.getAuthorizationCodeTimeToLive() == null : this.getAuthorizationCodeTimeToLive().equals(other.getAuthorizationCodeTimeToLive()))
            && (this.getAccessTokenTimeToLive() == null ? other.getAccessTokenTimeToLive() == null : this.getAccessTokenTimeToLive().equals(other.getAccessTokenTimeToLive()))
            && (this.getReuseRefreshTokens() == null ? other.getReuseRefreshTokens() == null : this.getReuseRefreshTokens().equals(other.getReuseRefreshTokens()))
            && (this.getRefreshTokenTimeToLive() == null ? other.getRefreshTokenTimeToLive() == null : this.getRefreshTokenTimeToLive().equals(other.getRefreshTokenTimeToLive()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getClientIcon() == null) ? 0 : getClientIcon().hashCode());
        result = prime * result + ((getClientId() == null) ? 0 : getClientId().hashCode());
        result = prime * result + ((getClientIdIssuedAt() == null) ? 0 : getClientIdIssuedAt().hashCode());
        result = prime * result + ((getClientSecret() == null) ? 0 : getClientSecret().hashCode());
        result = prime * result + ((getClientSecretExpiresAt() == null) ? 0 : getClientSecretExpiresAt().hashCode());
        result = prime * result + ((getClientName() == null) ? 0 : getClientName().hashCode());
        result = prime * result + ((getClientAuthenticationMethods() == null) ? 0 : getClientAuthenticationMethods().hashCode());
        result = prime * result + ((getAuthorizationGrantTypes() == null) ? 0 : getAuthorizationGrantTypes().hashCode());
        result = prime * result + ((getRedirectUris() == null) ? 0 : getRedirectUris().hashCode());
        result = prime * result + ((getPostLogoutRedirectUris() == null) ? 0 : getPostLogoutRedirectUris().hashCode());
        result = prime * result + ((getScopes() == null) ? 0 : getScopes().hashCode());
        result = prime * result + ((getAuthorizationCodeTimeToLive() == null) ? 0 : getAuthorizationCodeTimeToLive().hashCode());
        result = prime * result + ((getAccessTokenTimeToLive() == null) ? 0 : getAccessTokenTimeToLive().hashCode());
        result = prime * result + ((getReuseRefreshTokens() == null) ? 0 : getReuseRefreshTokens().hashCode());
        result = prime * result + ((getRefreshTokenTimeToLive() == null) ? 0 : getRefreshTokenTimeToLive().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", clientIcon=").append(clientIcon);
        sb.append(", clientId=").append(clientId);
        sb.append(", clientIdIssuedAt=").append(clientIdIssuedAt);
        sb.append(", clientSecret=").append(clientSecret);
        sb.append(", clientSecretExpiresAt=").append(clientSecretExpiresAt);
        sb.append(", clientName=").append(clientName);
        sb.append(", clientAuthenticationMethods=").append(clientAuthenticationMethods);
        sb.append(", authorizationGrantTypes=").append(authorizationGrantTypes);
        sb.append(", redirectUris=").append(redirectUris);
        sb.append(", postLogoutRedirectUris=").append(postLogoutRedirectUris);
        sb.append(", scopes=").append(scopes);
        sb.append(", authorizationCodeTimeToLive=").append(authorizationCodeTimeToLive);
        sb.append(", accessTokenTimeToLive=").append(accessTokenTimeToLive);
        sb.append(", reuseRefreshTokens=").append(reuseRefreshTokens);
        sb.append(", refreshTokenTimeToLive=").append(refreshTokenTimeToLive);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}